package cn.achao.csr.system.controller;

import cn.achao.csr.api.model.dto.OperaAddDTO;
import cn.achao.csr.base.resp.R;
import cn.achao.csr.system.service.SysOperationLogService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: achao
 **/
@Slf4j
@RestController
@RequestMapping("/log")
@RequiredArgsConstructor
public class SysOperationLogController {

    private final SysOperationLogService operationLogService;

    @PostMapping("/add")
    public R<?> add(@RequestBody @Validated OperaAddDTO req) {
        return R.ok(operationLogService.add(req), "添加成功");
    }

}
